#!/bin/bash

basepath=$(cd `dirname $0`; pwd)
port="$1"
package_name="$2"

if [ "$port" = "" ];then
  echo "Port should not be empty"
  exit -1;
fi

if [ "$package_name" = "" ];then
  echo "Project package name should not be empty"
  exit -1;
fi

nohup java -jar $basepath/gitee-ci-deploy.jar $port $package_name > $basepath/gitee-ci-deploy.log &

echo "Look at the gitee-ci-deploy.log. If start success, you can visit http://localhost:$port/deploy now."